package me.zhengjie.modules.monitor.rest;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import me.zhengjie.domain.CommonResult;
import me.zhengjie.domain.PageResult;
import me.zhengjie.modules.monitor.domain.TbCarDevOnline;
import me.zhengjie.modules.monitor.domain.vo.CarDevOnlineCriteria;
import me.zhengjie.modules.monitor.service.CarDevOnlineService;
import me.zhengjie.modules.system.domain.Dept;
import com.baomidou.mybatisplus.core.metadata.IPage;
import me.zhengjie.utils.PageUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequiredArgsConstructor
@Api(tags = "设备：设备在线管理")
@RequestMapping("/api/dev")
public class CarDevOnlineController {

	@Autowired
	private CarDevOnlineService carDevOnlineService;

	@ApiOperation("查询在线设备")
	@PostMapping("queryCarDevOnline")
//	@PreAuthorize("@el.check('user:list','dept:list')")
	public CommonResult queryCarDevOnline(@RequestBody CarDevOnlineCriteria criteria) throws Exception {
		IPage<TbCarDevOnline> page = carDevOnlineService.queryCarDevOnline(criteria);
		return PageResult.ok("查询成功", page.getRecords(), page.getTotal());
	}



}
